UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cpNh3B6ThL1bw7+t3zDXsTkmi7qqinkZNMp2FNjoi1g=' 
WHERE 
  key_id = '0fd5ac8459c823cf99d5ae56a5f989db8af0e62be2252704623a15fbca7f7464' 
  AND (
    token = 'cpNh3B6ThL1bw7+t3zDXsTkmi7qqinkZNMp2FNjoi1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050