UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dyLOMOxCuIF9fDqfsA/Z/DhxnEqXHzFSeN3LsChD8Po='
WHERE
key_id = '8758ce51cf2b0542741de25fc9f0cf30fdf6cf91361c73b6c64bd2016c2cd042'
AND (
token = 'dyLOMOxCuIF9fDqfsA/Z/DhxnEqXHzFSeN3LsChD8Po='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)