UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tUQE07XHFJvXGaMNPqNGv3l+i/rmbpCMXSGlfO4/n0g='
WHERE
key_id = '78d9e86f1a6a87929575e9405396e3bf64745d6ef4736f3efd9c14fdc0c3886b'
AND (
token = 'tUQE07XHFJvXGaMNPqNGv3l+i/rmbpCMXSGlfO4/n0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)