UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TAIPEhtmK9dwRhs350qnuK8tZufaSCOw9x5lin0YxaY=' 
WHERE 
  key_id = '84cbe22114d1d25c508e200d7df6d78d65bf6c0c289f65e59ebc06ac0d01c2b6' 
  AND (
    token = 'TAIPEhtmK9dwRhs350qnuK8tZufaSCOw9x5lin0YxaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059