UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uxCqpE8i9vG83XwuJ1Ob/CpdQappXkmp/FdG+fvBKd4='
WHERE
key_id = '03e1cb2d78df33c94131ccef488219e7e0b26d2d8a219db031ace63d17fd87a1'
AND (
token = 'uxCqpE8i9vG83XwuJ1Ob/CpdQappXkmp/FdG+fvBKd4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)