UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0gHrZhwIn3M7tmCK0mRW4eS5lQhV+K1Efgxn1NLi8CQ='
WHERE
key_id = 'b6cdb17001b3c180d190728992ba8ad72983b18a7e438cc106c409e4c913516f'
AND (
token = '0gHrZhwIn3M7tmCK0mRW4eS5lQhV+K1Efgxn1NLi8CQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)