UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c55jJH9FjVHdwz0KwQNVntm+gDyrOD3Vj4i49QlRsTA='
WHERE
key_id = 'c1ab96918a77f33d6b3385556eb2bd56a5c31532ab8a76e94a9bd535ad5bd1d7'
AND (
token = 'c55jJH9FjVHdwz0KwQNVntm+gDyrOD3Vj4i49QlRsTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)