UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'akS/QHgUFSswu9VMv/JPB6LdjJnelSR/1nbBGy9/I3k='
WHERE
key_id = 'fc5e06bfdb3aecacbbff5281e8d0326caa0a5015a53ff365a0de08afea02238e'
AND (
token = 'akS/QHgUFSswu9VMv/JPB6LdjJnelSR/1nbBGy9/I3k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)