UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tYF7TwBt/FsPqBHYT+ikWfcsP1FP9TlGzCe0KKbxKy0='
WHERE
key_id = '3f2403faf19ba765e6ce66a748d8f7963ef72fc809734bf3ce9f75de8d95ffc2'
AND (
token = 'tYF7TwBt/FsPqBHYT+ikWfcsP1FP9TlGzCe0KKbxKy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)