UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uJWpFFeBblBF+rWg0ClZ+cB8kJfdjBYhbVx7fCG2isU='
WHERE
key_id = '240d3835e0ff4a145ae5d6109fd8bd0f100a496e0133798e1febf9b86ba526d0'
AND (
token = 'uJWpFFeBblBF+rWg0ClZ+cB8kJfdjBYhbVx7fCG2isU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)