UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A/hwY7UKJLY5IYgEqLU6hjiWTntPr/cBLqAGk/4zajU='
WHERE
key_id = '2acc1316b018cf7cc5d1bc837d83761a8563b1131a5a6819f5efe98dc9b757b5'
AND (
token = 'A/hwY7UKJLY5IYgEqLU6hjiWTntPr/cBLqAGk/4zajU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)