UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jR2ABY/ecAgHYatHc6McfgqdiUqKhmzjW7pvW9hDYP0='
WHERE
key_id = 'abf6c3914110a64626e21e0591cc2a3401353968f1891d07fac397c01e300597'
AND (
token = 'jR2ABY/ecAgHYatHc6McfgqdiUqKhmzjW7pvW9hDYP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)