UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G7+WwjAyAgAAhCLOvgq2UUyzUNwuwPY+g0ng2VOwTnM='
WHERE
key_id = '02271205fb5519514898f83f7d85bcd63415add0fda7e8e2ddd082e7c00ee72e'
AND (
token = 'G7+WwjAyAgAAhCLOvgq2UUyzUNwuwPY+g0ng2VOwTnM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)