UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'irQdYMFm3HTmYwIhlwzn5QB//+3fZHXfD1RvnglsJj0='
WHERE
key_id = 'd07e3f2c469f4320aec8a8ee38a931ba9f78cb36a706f1c65336006a01cdb53d'
AND (
token = 'irQdYMFm3HTmYwIhlwzn5QB//+3fZHXfD1RvnglsJj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)