UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '44bJEV3G8qiXsqUu3r/kdNnP1j2O1gRcGzteknpUFIk='
WHERE
key_id = '59763ee8125e5a990cba67ec7eb50d58eb836de51167d565e4670bb0ad9f1267'
AND (
token = '44bJEV3G8qiXsqUu3r/kdNnP1j2O1gRcGzteknpUFIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)