UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fr+1xIKfDyQ0hgQSnKe9f/QDkZJNCjRsPzd4lAJ9TCE=' 
WHERE 
  key_id = '8d81dfe92a2a7e6e735bf7e9a73e0fca298ede3f54e6424d92569f98940f9d9f' 
  AND (
    token = 'Fr+1xIKfDyQ0hgQSnKe9f/QDkZJNCjRsPzd4lAJ9TCE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065