UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8/g6mkpaYRqBcum0FiZHL7H74utbP8JHBdYAc77eR7A=' 
WHERE 
  key_id = 'db3c8c5b4dfdc56e6920f224bef14116375f04ec48deb0869b32849e27ede1c7' 
  AND (
    token = '8/g6mkpaYRqBcum0FiZHL7H74utbP8JHBdYAc77eR7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060