UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rrByVMCNwbw2mPvPkvoN7BSieVP6XZfmH/nIQe5IPxU='
WHERE
key_id = '977bc5479325911f317a770e92fa6f4fe1787c8d74d486474833d3874191f8e2'
AND (
token = 'rrByVMCNwbw2mPvPkvoN7BSieVP6XZfmH/nIQe5IPxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)