UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nw5iVsaMVqyGKzpp9hGwOiB7d98Bu2j3ZjnrpeUZ7w0=' 
WHERE 
  key_id = '2a6a219e0f48137ccf390a98ae61e98b3e11f6719e2e4c13f1a2df2413ef71e2' 
  AND (
    token = 'Nw5iVsaMVqyGKzpp9hGwOiB7d98Bu2j3ZjnrpeUZ7w0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029