UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SsDwFjjVqsv2dsbasT9mzekyv7TjxVibOReGUGjHlnc=' 
WHERE 
  key_id = '30d266c42a6da8f3b56c8f45108db8193b8926fc21badb83b15e5d929cbaf3b6' 
  AND (
    token = 'SsDwFjjVqsv2dsbasT9mzekyv7TjxVibOReGUGjHlnc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027