UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CBX4CXTFNCeE3e692LRX1xSbTsWduwY1Xq3OT85hXGk='
WHERE
key_id = '6cf6fe68a9d56620ee3db0155a251de9349b496711ac3b32a93a74d53de5f2d8'
AND (
token = 'CBX4CXTFNCeE3e692LRX1xSbTsWduwY1Xq3OT85hXGk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)