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

Query time 0.00017