UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1QBrB1JVnagmBsWc8VQXT6+FcmzRgwuvaw0VjYzMYu0='
WHERE
key_id = '6a3045128f6be0487eddc47cda6ae5d2af0246cc5d4366d3b9f0e35314139779'
AND (
token = '1QBrB1JVnagmBsWc8VQXT6+FcmzRgwuvaw0VjYzMYu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)