UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zJdToCJMltIanHLBz8Iw0UOH9lk1zqyKfSLll/Pja9g=' 
WHERE 
  key_id = 'c53477863465b23fefb95b2ef57afd7e45d81f01b570bf8a48604c3c48482c56' 
  AND (
    token = 'zJdToCJMltIanHLBz8Iw0UOH9lk1zqyKfSLll/Pja9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023