UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k+nS3XLgybdPS7qypgc2Lmg6ijyRmiEvTChJS6l/Zbo=' 
WHERE 
  key_id = 'f7af9856ad0dd1511f177dd4ec6932432a88c17865d40345e9e40b6277b7b125' 
  AND (
    token = 'k+nS3XLgybdPS7qypgc2Lmg6ijyRmiEvTChJS6l/Zbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015