UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j1fKVOrSQu/1F75vl5xK3/AdFD5Y6j/glf77+ZSftmQ=' 
WHERE 
  key_id = '3a7ba7c7224d6cd144840fd901b3eb5a45b3c055cdedc8f391d499d1953a72ba' 
  AND (
    token = 'j1fKVOrSQu/1F75vl5xK3/AdFD5Y6j/glf77+ZSftmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064