UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1mAW0jeghxqg8hoGv42VlQ34LefWpYBWduYhKtezPAE=' 
WHERE 
  key_id = 'b7e01c93426ffad0889b253567194536154bcbc0b335f66dccc9ba96c538e042' 
  AND (
    token = '1mAW0jeghxqg8hoGv42VlQ34LefWpYBWduYhKtezPAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024