UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2PlUlIzBerNzcB+FaqZYCmIcNImT3x/CwaMLm4XQtOc=' 
WHERE 
  key_id = '2fa91291d842afb7c3d57b3125f97110cd7e76849d522eff8e0a88bfc4f5acfa' 
  AND (
    token = '2PlUlIzBerNzcB+FaqZYCmIcNImT3x/CwaMLm4XQtOc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024